
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>客服登陆页面</title>
    <link href="/css/css/style.css" rel="stylesheet" media="screen">
    <link href="/css/reset.css" rel="stylesheet" type="text/css"/>
    <link href="/js/layui/css/layui.css" rel="stylesheet" type="text/css" />

</head>
<body>
<div id="particles-js">
    <form class="login layui-form">
        <div class="login-top">
            登录
        </div>

        <div class="login-center clearfix">
            <!--隐藏的属性 ,默认值是 登录-->
            <input type="hidden" name="service" value="login" />
            <div class="login-center-img"><img src="/css/img/name.png"/></div>
            <div class="login-center-input">
                <input type="text" name="account"  id="account" placeholder="用户名" onfocus="this.placeholder=''" onblur="this.placeholder='请输入您的用户名'"/>
               <!-- <div class="login-center-input-text">用户名</div>-->
            </div>
        </div>
        <div class="login-center clearfix">
            <div class="login-center-img"><img src="/css/img/password.png"/></div>
            <div class="login-center-input">
                <input type="password" id="password" name="password" placeholder="用户密码" onfocus="this.placeholder=''" onblur="this.placeholder='请输入您的密码'"/>
               <!-- <div class="login-center-input-text">密码</div>-->
            </div>
        </div>
        <div class="login-center clearfix">
            <div class="login-center-img"><img src="/css/img/password.png"/></div>
            <div class="login-center-input">
                <input type="text" name="checkCode" placeholder="验证码" required lay-verify="required" style="width:120px"/>
                <img id="checkCode" alt="验证码" src="/checkCode" style="width: 70px;margin-left: 20px">
            </div>
        </div>

        <div class="login-center clearfix">
            <div class="login-center-img"></div>
            <div class="login-center-input">
                <div class="layui-btn layui-btn-radius layui-btn-normal" lay-submit lay-filter="loginBtnFilter">
                    登录
                </div>
                <div class="layui-btn layui-btn-radius layui-btn-normal" id="loginReset">
                    重置
                </div>
            </div>
        </div>

    </form>
    <div class="sk-rotating-plane"></div>
</div>
<div style="text-align:center;">
</div>

<script src="/css/js/layui/layui.js"></script>
<!--登录页调整星空粒子间隔,坐标...-->
<script src="/css/js/particles.min.js"></script>
<script src="/css/js/app.js"></script>
<script>
    layui.use(['form','layer','jquery'], function(){
        var form = layui.form,
            $ = layui.jquery,
            layer = layui.layer;
        form.on('submit(loginBtnFilter)', function(d){
            var data1 = form.val("login");
            $.post('/login/login',data1,function (rs) {
                if(rs.type=='success'){
                    location.href='/login/csindex';
                    return false;
                }else{
                    //登陆失败提示信息
                    layer.msg(rs.msg);
                    $("#checkCode").click();
                    $("input[name='checkCode']").val("");//清空之前输入框的数据
                    return false;
                }
            },"json");
        });
        //验证码点击事件
        $("#checkCode").click(function () {
            $(this).attr("src","/checkCode?"+new Date());
        });
        //重置绑定事件
        $("#loginReset").click(function () {
            //1.刷新页面
            //location.reload();
            //2.通过jquer赋值，进行重置
            $("#account").val("");
            $("#password").val("");
            $("#code").val("");
        });
    });
</script>
</body>
</html>









